<template>
   <div id="appContainer"></div>
</template>

<script setup>
import { onMounted, onBeforeUnmount, ref, onBeforeUpdate } from 'vue'
import { useRouter } from 'vue-router'
import { loadMicroApp, start } from 'qiankun'
const app = ref()
const router = useRouter()
onMounted(() => {
  app.value = loadMicroApp({
    name: "vitesub2",
    entry: "http://127.0.0.1:3001",
    container: "#appContainer",
    props: {
      router,
      brand: "传递数据",
    },
  })
  start({
    sandbox: {
      experimentalStyleIsolation: true, // 实验性的样式隔离特性
      // strictStyleIsolation: true  //严格的样式隔离模式  3.0 中要被遗弃
    },
  })
})

onBeforeUnmount(() => {
  app.value.unmount()
})


</script>

<style scoped></style>